<?php

/**
 * linketatdossier form base class.
 *
 * @method linketatdossier getObject() Returns the current form's model object
 *
 * @package    forumCDE
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaselinketatdossierForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'dossier_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('dossier'), 'add_empty' => true)),
      'etat_id'             => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etat'), 'add_empty' => true)),
      'acteur_id'           => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('acteur'), 'add_empty' => true)),
      'acteurnominatif_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('acteurnominatif'), 'add_empty' => true)),
      'acteurpersonne_id'   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('acteurpersonne'), 'add_empty' => true)),
      'prestataire'         => new sfWidgetFormInputCheckbox(),
      'prestatairenom'      => new sfWidgetFormInputText(),
      'prestatairejustif'   => new sfWidgetFormTextarea(),
      'commentaire'         => new sfWidgetFormTextarea(),
      'clotureauto'         => new sfWidgetFormInputCheckbox(),
      'readonly'            => new sfWidgetFormInputCheckbox(),
      'fermetechnique'      => new sfWidgetFormInputCheckbox(),
      'ferme'               => new sfWidgetFormInputCheckbox(),
      'datereference'       => new sfWidgetFormDate(),
      'anciendatereference' => new sfWidgetFormDate(),
      'visibilite'          => new sfWidgetFormInputText(),
      'personne_id'         => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('personne'), 'add_empty' => true)),
      'rolepersonne_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('rolepersonne'), 'add_empty' => true)),
      'ancienacteur_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('ancienacteur'), 'add_empty' => true)),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'dossier_id'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('dossier'), 'required' => false)),
      'etat_id'             => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('etat'), 'required' => false)),
      'acteur_id'           => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('acteur'), 'required' => false)),
      'acteurnominatif_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('acteurnominatif'), 'required' => false)),
      'acteurpersonne_id'   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('acteurpersonne'), 'required' => false)),
      'prestataire'         => new sfValidatorBoolean(array('required' => false)),
      'prestatairenom'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'prestatairejustif'   => new sfValidatorString(array('required' => false)),
      'commentaire'         => new sfValidatorString(array('required' => false)),
      'clotureauto'         => new sfValidatorBoolean(array('required' => false)),
      'readonly'            => new sfValidatorBoolean(array('required' => false)),
      'fermetechnique'      => new sfValidatorBoolean(array('required' => false)),
      'ferme'               => new sfValidatorBoolean(array('required' => false)),
      'datereference'       => new sfValidatorDate(array('required' => false)),
      'anciendatereference' => new sfValidatorDate(array('required' => false)),
      'visibilite'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'personne_id'         => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('personne'), 'required' => false)),
      'rolepersonne_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('rolepersonne'), 'required' => false)),
      'ancienacteur_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('ancienacteur'), 'required' => false)),
      'created_at'          => new sfValidatorDateTime(),
      'updated_at'          => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('linketatdossier[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'linketatdossier';
  }

}
